#include<bits/stdc++.h>
using namespace std;

int cnt[2];

signed main() {
	string s, t;
	while (cin >> t) {
		s += t;
	}

	cout << (int)(sqrt(s.size())) << " ";

	bool flag = 0;
	for (int i = 0; i < s.size(); i++) {

		if (s[i] - '0' != flag) {
			cout << cnt[flag] << " ";
			cnt[0] = cnt[1] = 0;
			flag ^= 1;
		}

		cnt[s[i] - '0']++;
	}
	cout << cnt[flag] << " ";
	return 0;
}
